package com.stock.controller;

import com.stock.api.StockControllerAPI;
import com.stock.entity.StockBusiness;
import com.stock.service.StockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;
import com.stock.response.ResponseResult;
import java.util.List;

@RestController
public class StockController implements StockControllerAPI {
    @Autowired
    private final StockService stockService;

    public StockController(StockService stockService) {
        this.stockService = stockService;
    }


    @Override
    public ResponseResult<List<StockBusiness>> getStockBusiness() {
        List<StockBusiness> stockBusiness = stockService.getStockBusiness();
        return ResponseResult.ok(stockBusiness);
    }
}